<?php
/**
 * AppShell file
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @since         CakePHP(tm) v 2.0
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */

/**
 * Application Shell
 *
 * Add your application-wide methods in the class below, your shells
 * will inherit them.
 *
 * @package       app.Console.Command
 */
 // 全マスタ保護
class BackupDBShell extends AppShell {
    public $uses = array('ExportMonthLyDataModel');	
    public function main() {
        $this->out('Start 全マスタ保護');
		try {
		// backup shipper
		$this->ExportMonthLyDataModel->backShipper();
		$this->out('Backup shipper done');
		// backup area
		$this->ExportMonthLyDataModel->backArea();
		$this->out('Backup area done');
		// backup shipping fee
		$this->ExportMonthLyDataModel->backShipping();
		$this->out('Backup shipping fee done');
		// backup kanri
		$this->ExportMonthLyDataModel->backKanri();
		$this->out('Backup kanri done');
		// backup diff shipper
		$this->ExportMonthLyDataModel->backDiffShipper();
		$this->out('Backup diff shipper done');
		// backup diff product
		$this->ExportMonthLyDataModel->backDiffProduct();
		$this->out('Backup diff product done');			
		} catch(Exception $ex) {
			echo 'Exception:' . $ex->getMessage();
		}
		$this->out('End 全マスタ保護');
    }
	
	
}
